@(qcm: Qcm, mess: String)
@import helper._


@main("Notation"){
@header()
@helper.form(action = routes.ModifierQCM.submit(3)) {
	<fieldset>
	<div class="bs-docs-example" >
	<div class="bs-docs-example-after" >
		Etape 3 sur 4
		</div>	
	
		<legend>QCM : Information gen&eacute;ral</legend>	
		<br/>
					<div>
					<label>Libell&eacute; : </label>
					<INPUT type="text" name="libelle" value="@qcm.getLibelle()" disabled="disabled">
					</div>
					
					<div class="row">
					<div class="span4">
				   <label>Date d'ouverture du Qcm : </label>
				    <INPUT type="text" name="libelle" value="@qcm.getDateOuverture().format("dd/MM/yyyy HH:mm")" disabled="disabled">
				    </div>
				    <div class="span4">
				    <label>Date de cloture du Qcm : </label>
				    <INPUT type="text" name="libelle" value="@qcm.getDateCloture().format("dd/MM/yyyy HH:mm")" disabled="disabled">
 		
				 	</div>
				 	</div>
				</br> 	
			<legend>Liste des questions</legend>	
						<table class="table table-striped sortable">
					
						<thead>
							<tr>
								<th>Libell&eacute </th>
								<th>Niveau de difficult&eacute </th>
							</tr>
							<thead>
							<tbody>
							@for(question <- qcm.getListeQuestions()){
							<tr>
							<td>@question.getLibelleQuestion()</td>
							<td>@question.getNiveauQuestion().getLibelleNiveau() </td>
							</tr>
							}
							</tbody>
						</table>
						
						
			<legend>Notation : </legend>
</br>
	
@for(niveauQuestion <- qcm.getListeNiveauQuestions()){
<h5>@niveauQuestion.getNiveauQuestion().getLibelleNiveau()</h5>	
<div class="row">
    <div class="ppf control-group span4">
      <div class="controls">
      	<label>Point Positif</label>
        <input type="text" name="@niveauQuestion.getIdQcmNiveauQuestion()p" id="@niveauQuestion.getIdQcmNiveauQuestion()p" class="checkable" value="@niveauQuestion.getPointPositif()" required>
        <div class="alertppf alert alert-error hide">
          <h4 class="alert-heading">Erreur !</h4>
          Vous devez entrer un nombre positif (ex: 0.5 ou 1) ! </div>
      </div>
    </div>
	<div class="pnf control-group span4">
	      <div class="controls">
	      	<label>Point Negatif</label>
	        <input type="text" name="@niveauQuestion.getIdQcmNiveauQuestion()n" id="@niveauQuestion.getIdQcmNiveauQuestion()n" class="checkable" value="@niveauQuestion.getPointNegatif()" required>
	        <div class="alertpnf alert alert-error hide">
	          <h4 class="alert-heading">Erreur !</h4>
	          Vous devez entrer un nombre positif (ex: 0.5 ou 1) ! </div>
	      </div>
	    </div>
	</div> 
}
</div>
</fieldset>
		
            
 <div class="actions"> 	
 		
 		@if(mess==null){	
     	<button id="action" type="submit" name="action" value="retour" class="btn btn-primary">
			Retour <i class="icon-white icon-circle-arrow-left"></i> 
		</button>
		<button type="submit" name="action" value="home"class="btn btn-primary">
 		<i class="icon-white icon-home"></i> Valider et retour &agrave l'accueil
 		</button> 
		}
		@if(mess!=null){
		<button type="submit" name="action" value="home"class="btn btn-primary">
 		<i class="icon-white icon-home"></i> Valider et retour au d&eacute;tail du qcm
 		</button>
		}
</div>
<script type="text/javascript">


$(function(){
    $("form").on("submit", function(){
    	
    		// INIT
    		var returnStatement = true;
    	
    	
    		$('.checkable').each(function(){
    			
    			// GET Input Value
    			var inputValue = $(this).val();
    			var inputValueFloat = parseFloat(inputValue);
    			
    			if (!isFinite(inputValue)||inputValueFloat < 0) {
    				$(this).addClass("error");
    			    $(this).next('.alert-error').show("slow").delay(3500).hide("slow");
    			    returnStatement =  false;
    			}
    			
    		});
    	
    		return returnStatement;
    	
    });    
});

}
}
